package com.meilai.project.controller.web.market.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.meilai.project.controller.web.market.entity.BillMarketConfirm;
import com.meilai.project.controller.web.market.mapper.BillMarketConfirmMapper;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.stream.Collectors;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author xchen
 * @since 2022-07-17
 */
@Service
public class BillMarketConfirmServiceImpl extends ServiceImpl<BillMarketConfirmMapper, BillMarketConfirm> implements BillMarketConfirmService {

    @Override
    public List<Long> queryMarketIdListByConfirmBatch(String confirmBatch) {
        LambdaQueryWrapper<BillMarketConfirm> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(BillMarketConfirm::getBatch_id, confirmBatch);
        wrapper.select(BillMarketConfirm::getBill_market_id);
        List<BillMarketConfirm> list = list(wrapper);
        return list.stream().map(BillMarketConfirm::getBill_market_id).collect(Collectors.toList());
    }
}
